<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name="robots" content="noindex, nofollow">
    <meta name="googlebot" content="noindex, nofollow">

    <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.1/angular.js"></script>


    <style type="text/css">
        .fess {
            border: 1px solid red;
        }
    </style>

    <title></title>


</head>

<body>
<div ng-app="miniapp" ng-controller="AppController">
    <div class="fess" ng-style="resizeWithOffset(165)" resize>
        window.height: {{windowHeight}} <br/>
        window.width: {{windowWidth}} <br/>
    </div>
</div>


<script type='text/javascript'>//<![CDATA[

var app = angular.module('miniapp', []);

function AppController($scope) {
}

app.directive('resize', function ($window) {
    return function (scope, element, attr) {

        var w = angular.element($window);
        scope.$watch(function () {
            return {
                'h': window.innerHeight,
                'w': window.innerWidth
            };
        }, function (newValue, oldValue) {
            console.log(newValue, oldValue);
            scope.windowHeight = newValue.h;
            scope.windowWidth = newValue.w;

            scope.resizeWithOffset = function (offsetH) {
                scope.$eval(attr.notifier);
                return {
                    'height': (newValue.h - offsetH) + 'px'
                };
            };

        }, true);

        w.bind('resize', function () {
            scope.$apply();
        });
    }
});
//]]> 

</script>

<script>
    // tell the embed parent frame the height of the content
    if (window.parent && window.parent.parent) {
        window.parent.parent.postMessage(["resultsFrame", {
            height: document.body.getBoundingClientRect().height,
            slug: "None"
        }], "*")
    }
</script>

</body>

</html>

